package lab02.test06;

public class Ladder {
    private double upper;
    private double bottom;
    private double height;
    private double area;

    public Ladder(){}

    public Ladder(double upper, double bottom, double height) {
        this.upper = upper;
        this.bottom = bottom;
        this.height = height;
    }

    public double getUpper() {
        return upper;
    }

    public void setUpper(double upper) {
        this.upper = upper;
    }

    public double getBottom() {
        return bottom;
    }

    public void setBottom(double bottom) {
        this.bottom = bottom;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }
    //用area方法求梯形的面积
    public double area(){
        area = (upper + bottom) * height / 2;
        return area;
    }
}
